package cn.webestar.scms.user.api.dto.SysLog;

import cn.webestar.scms.commons.api.UpdateBody;
import cn.webestar.scms.user.entity.SysLog;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.Date;

@Data
@Schema(description = "SysLogUpdateDTO")
public class SysLogUpdateDTO extends UpdateBody {

    private Long id;

    @Schema(description = "事件触发者")
    private String actor;

    @Schema(description = "触发者ip")
    private String actorIp;

    @Schema(description = "触发者类型，1：系统，2：员工，3：用户")
    private Integer actorType;

    @Schema(description = "事件产生时间")
    private Date eventTime;

    @Schema(description = "事件描述")
    private String eventDesc;

    @Schema(description = "创建时间")
    private Date createTime;

    @Override
    public Long getId() {
        return id;
    }

    @Override
    public SysLog toDO() {
        SysLog o = new SysLog();
        o.setId(id);
        o.setActor(actor);
        o.setActorIp(actorIp);
        o.setActorType(actorType);
        o.setEventTime(eventTime);
        o.setEventDesc(eventDesc);
        o.setCreateTime(createTime);
        return o;
    }

}
